<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%base_jyjf}}".
 *
 * @property integer $id
 * @property integer $user_id
 * @property string $company_name
 * @property string $goods_name
 * @property string $tsnr
 * @property string $img
 * @property string $clyj
 * @property integer $status
 */
class BaseJyjf extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%base_jyjf}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id', 'status'], 'integer'],
            [['djbzj'], 'number'],
            [['tsnr', 'img_url1','img_url2','img_url3','img_url4', 'clyj'], 'string'],
            [['company_name', 'goods_name','add_time','deal_time'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => '用户ID',
            'company_name' => '商家名称',
            'goods_name' => '产品名称',
            'tsnr' => '投诉内容',
            'img_url1' => '图片1',
            'img_url2' => '图片2',
            'img_url3' => '图片3',
            'img_url4' => '图片4',
            'clyj' => '处理意见',
            'status' => '处理状态1处理中 2处理完',
            'add_time' => '插入时间',
            'deal_time' => '处理时间',
            'djbzj' => '冻结保证金',
        ];
    }
    
     public function addJyjf($data, $uid) {     
        foreach ($data as $k=>$v) {             
                $this->$k =$v;          
        }$this->add_time=date('Y-m-d H:i:s');
         if($this->save()){
             return true;
         }else{
             return false;
         }
  
    }
}
